<nav aria-label="Main" id="site-nav" class="site-nav">
  {{ $currentPage := . }}
  <ul class="nav-list">

    {{ range $i, $el := .Site.Menus.main }}
      <li class="nav-list-item{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">
        {{ if .HasChildren }}<a href="#" class="nav-list-expander" aria-label="toggle links in UI Components category"> <svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg> </a>{{ range first 1 .Children }}<a class="nav-list-link" href="{{ .URL }}">{{ end }}{{ .Name }}</a><ul class="nav-list">{{ else }}<a href="{{ .URL }}" class="nav-list-link{{ if $currentPage.IsMenuCurrent "main" . }} active{{ end }}">{{ .Name }}</a>{{ end }}

        {{ range .Children }}
          <li class="nav-list-item{{ if $currentPage.HasMenuCurrent "main" . }} active{{ end }}">
            <a href="{{.URL}}" class="nav-list-link{{ if $currentPage.IsMenuCurrent "main" . }} active{{ end }}">{{ .Name }}</a>
          </li>
        {{ end }}

        {{ if .HasChildren }}</ul>{{ end }}
      </li>
    {{ end }}
    <li class="nav-list-item external">
      <a href="https://github.com/mysql-net/MySqlConnector" class="nav-list-link external">GitHub
      <svg viewBox="0 0 24 24" aria-labelledby="svg-external-link-title"><use xlink:href="#svg-external-link"></use></svg></a>
    </li>
  </ul>
</nav>
